﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HRM.Entity;

namespace HRM.DAL
{
    public class UserDAL:BaseDAL
    {
        public HRUser GetUser(int userID)
        {
            return Repository.Single<HRUser>(user => user.ID == userID);
        }

        public HRUser GetUser(string userName)
        {
            return Repository.Single<HRUser>(user => user.UserName == userName);
        }

        public HRUser GetUser(string userName, string password)
        {
            return Repository.Single<HRUser>(user => user.UserName == userName && user.Password == password);
        }

        public List<HRUser> GetAllUser()
        {
            return Repository.All<HRUser>().ToList();            
        }
    }
}
